﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _04_CompareTwoFiles
{
    class CompareTwoFiles
    {
        static void Main(string[] args)
        {
            StreamReader firstReader = new StreamReader("text01.txt");
            StreamReader secondReader = new StreamReader("text02.txt");
            int equalLines = 0;
            int differantLines = 0;
            using (firstReader)
            using (secondReader)
            {
                while (firstReader.EndOfStream != true || secondReader.EndOfStream != true)
                {
                    string firstStr = firstReader.ReadLine();
                    string secondStr = secondReader.ReadLine();
                    if (firstStr == secondStr)
                    {
                        equalLines++;
                    }
                    else
                    {
                        differantLines++;
                    }
                }
            }
            Console.WriteLine("The number of the same lines is: {0}", equalLines);
            Console.WriteLine("The number of the diferent lines is: {0}", differantLines);
        }
    }
}
